{layout name="admin:layout" /}
<div class="tipbox tipbox-message">
    <span class="fn-fb">友情提示:</span>
    <p class="gray">
    1、请打开微信公众号平台配置接口信息,网址:<a href="https://mp.weixin.qq.com" target="_blank">https://mp.weixin.qq.com</a><br /> 
    2、获取开发者ID(AppID)和开发者密码(AppSecret)：开发->基本设置->公众号开发信息<br /> 
    3、设置业务域名：点击公众号设置->功能设置->业务域名设置(域名：<span class="red">{$Request.host}</span>)<br />     
    4、填写授权回调页面域名：开发者中心->网页授权获取用户基本信息->修改(域名：<span class="red">{$Request.host}</span>)
    </p>
</div>
<form id="form" action="{url('sysyte/admin.setting/wechatMp')}">
    <table class="formtable">
        <tr>
            <th>AppID:</th>
            <td><input class="input" datatype="*" type="text" name="app_id" value="{$info.app_id}" /></td>
        </tr>
        <tr>
            <th>AppSecret:</th>
            <td><input class="input w400" datatype="*" type="text" name="secret" value="{$info.secret}" /></td>
        </tr>
        <tr><th> 授权验证(URL):</th><td>{:url('system/v1.wechat/auth','',true,true)}</td></tr>
        <th>Token:</th>
            <td class="button-group">
                <input id="token" readonly="readonly" datatype="alphanum" class="input w400 fn-left readonly" type="text" name="token" value="{$info.token}" />
                <button type="button" class="token button "><i class="iconfont icon-refresh_icon"></i></button>    
            </td>
        </tr>
        <tr>
            <th>EncodingAESKey:</th>
            <td class="button-group">
                <input id="aes_key" readonly="readonly" datatype="alphanum" class="input w400 fn-left readonly" type="text" name="aes_key" value="{$info.aes_key}" />
                <button type="button" class="aes_key button "><i class="iconfont icon-refresh_icon"></i></button> 
            </td>
        </tr>
        <tr>
            <th></th>
            <td>
                <input type="submit" value="确定" class="button submit" />
                <input type="reset" value="重置" class="button button-blank" />
            </td>
        </tr>
    </table>
</form>
<script type="text/javascript">
    Do('base', 'layer', 'form', function () {
        $('#form').isForm();
        $('.token').click(function(){
            var key = randomWord(32,32,32)
            $('#token').val(key)
        })
        $('.aes_key').click(function(){
            var key = randomWord(43,43,43)
            $('#aes_key').val(key)
        })
    })
    </script>